/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.poll.om.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hopes.bizz.poll.om.dto.PollRtDataDTO;
import com.hopes.bizz.poll.om.entity.BaseOmDataEntity;
import com.hopes.bizz.poll.om.entity.PollRtDataHisEntity;
import com.hopes.bizz.poll.om.vo.PollRtDataVO;
import com.hopes.boss.common.data.datascope.BossBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 实时监控数据历史
 *
 * @author daijie
 * @date 2023-05-23 15:29:53
 */
@Mapper
public interface PollRtDataHisMapper extends BossBaseMapper<PollRtDataHisEntity> , MonitorHisMapper {

    /**
     * 根据监控点和时间删除
     *
     * @param omDataEntity
     */
    void deleteByMonitorSiteIdAndDataTime(BaseOmDataEntity omDataEntity);

    // 根据时间和监控点点查询历史数据
    List<PollRtDataVO> queryByTimeAndMonitor(PollRtDataDTO pollRtDataDTO);

    // 根据时间和监控点List
    List<PollRtDataHisEntity> queryByTimeAndMonitorList(PollRtDataDTO pollRtDataDTO);

    Page<PollRtDataVO> selectPageByMonitorSiteIdAndDataType(Page<PollRtDataVO> page, @Param("entity") PollRtDataDTO entity);

    /**
     * 获取数据最小时间
     * @return
     */
    Date getMinimumDataTime();
}
